import abc
from typing import Generic, TypeVar

AnyValue = TypeVar("AnyValue")
AnyPatch = TypeVar("AnyPatch")


class Metric(Generic[AnyValue, AnyPatch], abc.ABC):
    @abc.abstractmethod
    def compute(self) -> AnyValue:
        pass

    @abc.abstractmethod
    def update(self, patch: AnyPatch):
        pass

    @abc.abstractmethod
    def reset(self):
        pass
